#ifndef HOMECONTROLLER
#define HOMECONTROLLER

#include "../../base/RequestParser/RequestParser.h"
#include "../../base/TemplateParser/Template.h"
#include "../../base/Model/Model.hpp"

class HomeController: public BaseObj{
	public:

		HomeController(){start();};		
	private:					
		void start();		
 };
void HomeController::start(){
	//cout<<"Home Controller";
	RequestParser::layout="index";
	Model testmodel=Model();
	testmodel.name="sensor";
	//testmodel.find2();

	map<string,boost::any> rs= testmodel.findAll();
/*
	for(int i=0;i<rs.size();i++){
		cout<<"row "+ StringProcessor::itoa(i) +":"<<endl;

			cout<<"[time]=>["+rs[i]["time"]+"]"<<endl;

	}

*/
	//render html
	Template tpl;
	tpl.ViewData["db"]=rs;
	tpl.start();
}
 #endif
